﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using BrokerBase.Lib.Person;
using Telerik.Windows.Controls;

namespace Broker.View.Converter
{
    public class RelationPersonConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //RadGridView gv = parameter as RadGridView;

            Person person = parameter as Person;

            HumanRelation hr = value as HumanRelation;

            return (hr.Person1 as Person).Id == person.Id ? hr.Person2.Name : hr.Person1.Name;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
